import { onMounted, onUnmounted, reactive } from 'vue';

export default function(){
        let point = reactive({
            x:0,y:0
        })
        function setPoint(e){
            point.x = e.pageX
            point.y = e.pageY
        }
        onMounted(()=>{
            window.addEventListener('mousemove',setPoint)
            console.log(point)
        })
        onUnmounted(()=>{
            window.removeEventListener('mousemove',setPoint)
            console.log(point)
        })
        return point
    }